#include <bits/stdc++.h>
using namespace std;
long long n,m;

vector<int> choosn;

void dfs(int x)
{
	if(choosn.size()==m)
	{
		for(auto i:choosn) cout<<i<<" ";
        cout<<endl;
        return;
	}
    if(x>n)
    {
        return;
    }
    if(choosn.size()>m||choosn.size()+(n-x+1)<m) return;
    choosn.push_back(x);
    dfs(x+1);
    choosn.pop_back();
    dfs(x+1);
}

int main()
{
	cin>>n>>m;
	dfs(1);
	return 0;
 } 
